//
//  ZFTab1ViewController.m
//  PersistentPlan
//
//  Created by zhoufei on 16/4/14.
//  Copyright © 2016年 zhoufei. All rights reserved.
//

#import "ZFTab1ViewController.h"
#import "ZFFirstSubVC.h"
#import "Masonry.h"

@implementation ZFTab1ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self.view setBackgroundColor:[UIColor whiteColor]];
    
    self.title=@"首页";
    
    [self createSubViews];
}

- (void)createSubViews
{
    UITextField *title =[[UITextField alloc]init];
    [self.view addSubview:title];
    title.placeholder=@"请输入网址：";
    title.borderStyle=UITextBorderStyleRoundedRect;
    [title setBounds:CGRectMake(0, 0, 300, 44)];
    title.center=CGPointMake(self.view.center.x, self.view.center.y-240);
    
    UIButton *btn =[UIButton buttonWithType:UIButtonTypeSystem];
    [btn setTitle:@"走起..." forState:UIControlStateNormal];
    btn.titleLabel.font=[UIFont systemFontOfSize:18];
    [btn setTitleColor:[UIColor darkGrayColor] forState:UIControlStateNormal];
    [btn setBackgroundColor:[UIColor colorWithRed:190/255.0 green:133/255.0 blue:86/255.0 alpha:1]];
    [self.view addSubview:btn];
    [btn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.mas_equalTo(title.mas_width);
        make.height.mas_equalTo(50);
        make.left.equalTo(title.mas_left);
        make.top.equalTo(title.mas_bottom).with.mas_offset(20);
    }];
    [btn addTarget:self action:@selector(btnAction:) forControlEvents:UIControlEventTouchUpInside];
   
}

- (void)btnAction:(UIButton*)btn
{
    ZFFirstSubVC *firstSubVC =[[ZFFirstSubVC alloc]init];
    
    [self presentViewController:firstSubVC animated:YES completion:nil];
}

@end
